home *** CD-ROM | disk | FTP | other *** search
/ PC/CD Gamer UK 39 / PCGAMER39.bin / games / amber / amberhub.dxr / 00002_setUpGame, putAwayGame.ls < prev    next >
Encoding:
Text File  |  1996-11-08  |  6.4 KB  |  162 lines

  1. on setUpGame
  2.   global oStoryteller, oPuppeteer, domainIsReady, ForwardToRight, ForwardToLeft, ForwardToBrowse, ForwardToExamine, BrowseToRight, BrowseToLeft, BrowseToExamine, RightToLeft, RightToExamine, ExamineToLeft, RightToForward, LeftToForward, BrowseToForward, ExamineToForward, RightToBrowse, LeftToBrowse, ExamineToBrowse, LeftToRight, ExamineToRight, LeftToExamine, YugoCursors, castCursorList, cursorOffset, maxCursor, lastCursor, thisCursor, building, lastScoreSprite, gCPU, oBackdrop, oUtility, oFixPal, oMemory, colorcrsr, gAmberPath, gProjectorPath, gSoundPath, gSoundPath2, gHDsounds, gOldSndLevel, gCurrentPalette, gDeferredTransit, gClickLoc
  3.   set gDeferredTransit to #None
  4.   if gCPU = #PC then
  5.     set the exitLock to 1
  6.     set gSoundPath to gProjectorPath & "GAMEDATA\"
  7.     set gSoundPath2 to gAmberPath & "CD_DATA\"
  8.   else
  9.     set gSoundPath to gProjectorPath & "sounds etc.:"
  10.     set gSoundPath2 to gAmberPath & "CD_SOUNDS:"
  11.   end if
  12.   set gHDsounds to listHDsounds(gSoundPath)
  13.   set gOldSndLevel to the soundLevel
  14.   put "ΓÇóthe searchPath ="
  15.   put the searchPath
  16.   set gCurrentPalette to 0
  17.   set gClickLoc to #None
  18.   if gCPU = #PC then
  19.     openXLib(gProjectorPath & "MOVUTILS.DLL")
  20.     openXLib(gProjectorPath & "MEMORY.DLL")
  21.     openXLib(gProjectorPath & "MISC_X.DLL")
  22.     openXLib(gProjectorPath & "ScrnUtil.x32")
  23.   else
  24.     openXLib(gProjectorPath & "AMBER resources")
  25.     openResFile(gProjectorPath & "AMBER resources")
  26.   end if
  27.   set the searchCurrentFolder to 0
  28.   if gCPU = #PC then
  29.     set oUtility to MOVUTILS(mnew)
  30.   else
  31.     set oUtility to MovieUtilities(mnew)
  32.   end if
  33.   put "oUtility = " & oUtility
  34.   if gCPU <> #PC then
  35.     set oFixPal to FixPalette(mnew, the stageLeft, the stageTop, the stageRight, the stageTop)
  36.     put "oFixPal = " & oFixPal
  37.     set colorcrsr to colorcursor(mnew)
  38.     put "colorcrsr = " & colorcrsr
  39.   end if
  40.   if gCPU = #PC then
  41.     if the colorDepth < 16 then
  42.       alert("Sorry, AMBER: Journeys Beyond requires 'High Color' (16-bit color) on this display. Please set your Display control panel to 16-bit color and restart Windows.")
  43.       put "Quitting now..."
  44.       quit()
  45.     end if
  46.     if the quickTimePresent = 0 then
  47.       alert("Sorry, AMBER: Journeys Beyond requires QuickTime to run properly. Please install QuickTime for Windows 2.1 or higher.")
  48.       put "Quitting now..."
  49.       quit()
  50.     end if
  51.   else
  52.     gammaFade(#down)
  53.     setColor(8)
  54.     setColor(16)
  55.     gammaFade(#up)
  56.   end if
  57.   if objectp(oMemory) then
  58.     oMemory(mdispose)
  59.   end if
  60.   set oMemory to memory(mnew)
  61.   if not objectp(oMemory) then
  62.     alert("Memory XObject could not initialize.")
  63.     exit
  64.   end if
  65.   if gCPU <> #PC then
  66.     if not objectp(oBackdrop) then
  67.       set oBackdrop to RearWindow(mnew, "S")
  68.     end if
  69.     set howHigh to oBackdrop(mGetScreenBottom) - oBackdrop(mGetScreenTop)
  70.     set howWide to oBackdrop(mGetScreenRight) - oBackdrop(mGetScreenLeft)
  71.     if (howHigh > 480) or (howWide > 640) then
  72.       put "using RearWindow:" && oBackdrop
  73.       oBackdrop(mPatToWindow, -5)
  74.     else
  75.       put "small monitor; dumping RearWindow:" && oBackdrop(mdispose)
  76.     end if
  77.   end if
  78.   set domainIsReady to 0
  79.   set YugoCursors to [#browse: 6018, #left: 6012, #right: 6006, #forward: 6001, #back: 3003, #examine: 6024, #up: 6111, #down: 6112, #pointer: 6100, #noCursor: 128, #weedkiller: 6102, #ScanDevice: 6103, #Oscillator: 6108, #Headgear: 6107, #BedroomKey: 6106, #Crowbar: 6105, #Videotape: 6104, #None: 6100, #PeekUnit: 6100, #nextPage: 6110, #rotateRight: 6109, #rotateLeft: 6119]
  80.   set lastCursor to #None
  81.   set thisCursor to #pointer
  82.   set lastScoreSprite to 12
  83.   set ForwardToRight to [6001, 6002, 6003, 6004, 6005, 6006]
  84.   set ForwardToLeft to [6007, 6008, 6009, 6010, 6011, 6012]
  85.   set ForwardToBrowse to [6013, 6014, 6015, 6016, 6017, 6018]
  86.   set ForwardToExamine to [6019, 6020, 6021, 6022, 6023, 6024]
  87.   set BrowseToRight to [6025, 6026, 6027, 6028, 6029, 6030]
  88.   set BrowseToLeft to [6031, 6032, 6033, 6034, 6035, 6036]
  89.   set BrowseToExamine to [6037, 6038, 6039, 6040, 6041, 6042]
  90.   set RightToLeft to [6043, 6044, 6045, 6046, 6047, 6048]
  91.   set RightToExamine to [6049, 6050, 6051, 6052, 6053, 6054]
  92.   set ExamineToLeft to [6055, 6056, 6057, 6058, 6059, 6060]
  93.   set RightToForward to [6006, 6005, 6004, 6003, 6002, 6001]
  94.   set LeftToForward to [6012, 6011, 6010, 6009, 6008, 6007]
  95.   set BrowseToForward to [6018, 6017, 6016, 6015, 6014, 6013]
  96.   set ExamineToForward to [6024, 6023, 6022, 6021, 6020, 6019]
  97.   set RightToBrowse to [6030, 6029, 6028, 6027, 6026, 6025]
  98.   set LeftToBrowse to [6036, 6035, 6034, 6033, 6032, 6031]
  99.   set ExamineToBrowse to [6042, 6041, 6040, 6039, 6038, 6037]
  100.   set LeftToRight to [6048, 6047, 6046, 6045, 6044, 6043]
  101.   set ExamineToRight to [6054, 6053, 6052, 6051, 6050, 6049]
  102.   set LeftToExamine to [6060, 6059, 6058, 6057, 6056, 6055]
  103.   set oStoryteller to birth(script "cStoryteller")
  104.   set oPuppeteer to birth(script "cPuppeteer")
  105.   set the exitLock to 1
  106.   updateStage()
  107. end
  108.  
  109. on listHDsounds sndPath
  110.   set HDsounds to []
  111.   repeat with filenumber = 1 to 1000
  112.     set fName to getNthFileNameInFolder(sndPath, filenumber)
  113.     if fName = EMPTY then
  114.       exit repeat
  115.       next repeat
  116.     end if
  117.     add(HDsounds, fName)
  118.   end repeat
  119.   sort(HDsounds)
  120.   sort(HDsounds)
  121.   return HDsounds
  122. end
  123.  
  124. on zzzzputAwayGame
  125.   global oStoryteller, oPuppeteer, oBackdrop, oUtility, oFixPal, oMemory, colorcrsr
  126.   put "executing 'putAwayGame'..."
  127.   if objectp(oBackdrop) then
  128.     put "disposing of oBackdrop: " & RearWindow(mError, oBackdrop(mdispose))
  129.   end if
  130.   if objectp(the currentGameFile of oStoryteller) then
  131.     put "yup, currentGameFile is an object"
  132.     set oFile to the currentGameFile of oStoryteller
  133.     put "oFile = " & oFile
  134.     put "disposing of oFile: " & FileIO(mError, oFile(mdispose))
  135.   end if
  136.   if objectp(oUtility) then
  137.     put "yup, oUtility is an object"
  138.     put "oUtility = " & oUtility
  139.     put "disposing of oUtility: " & MovieUtilities(mError, oUtility(mdispose))
  140.   end if
  141.   if objectp(oFixPal) then
  142.     put "yup, oFixPal is an object"
  143.     put "oFixPal = " & oFixPal
  144.     put "disposing of oFixPal: " & FixPalette(mError, oFixPal(mdispose))
  145.   end if
  146.   if objectp(colorcrsr) then
  147.     put "yup, colorcrsr is an object"
  148.     put "colorcrsr = " & colorcrsr
  149.     put "disposing of colorcrsr: " & colorcursor(mError, colorcrsr(mdispose))
  150.   end if
  151.   if objectp(oMemory) then
  152.     put "yup, oMemory is an object"
  153.     put "disposing of oMemory: " & oMemory(mdispose)
  154.   end if
  155.   set oStoryteller to 0
  156.   set oPuppeteer to 0
  157.   closeXLib()
  158.   closeResFile()
  159.   put "THAT'S ALL, FOLKS!"
  160.   quit()
  161. end
  162.